package ink.zhaohui;

public class DogWork implements IWork {
  private String name="DogWork";

  @Override
  public int add(int a, int b) {
    try {
      Thread.sleep(3 * 1000);
    } catch (InterruptedException e) {
      throw new RuntimeException(e);
    }
    return a + b;
  }

  @Override
  public void work(String item) {
    try {
      Thread.sleep(3 * 1000);
    } catch (InterruptedException e) {
      throw new RuntimeException(e);
    }
    System.out.println("Dog work:" + item+":"+name);
  }

  @Override
  public void setName(String name) {
    this.name=name;
  }

  @Override
  public String getName() {
    return name;
  }
}
